from typing import List

class Solution:
    def maxProduct(self, words: List[str]) -> int:
        i = 0
        l = len(words)
        r = 0
        while i < l - 1:
            w1 = words[i]
            j = i + 1
            while j < l:
                w2 = words[j]
                if len(w1) * len(w2) > r and not self.__intersected(w1, w2):
                    r = max(r, len(w1) * len(w2))
                j += 1
            i += 1
        return r

    def __intersected(self, str1, str2):
        for c in str1:
            if c in str2:
                return True
        return False

solu = Solution()
result = solu.maxProduct(["abcw","baz","foo","bar","xtfn","abcdef"])
print(result)